package com.pai4j.jianlipai.controller.jianlibot;

import com.pai4j.common.bean.PAIResponseBean;
import com.pai4j.common.bean.PAIResponseBeanUtil;
import com.pai4j.common.enums.jianlibot.ResumeTemplateEnum;
import com.pai4j.domain.vo.response.jianlipai.ResumeTemplateVO;
import com.pai4j.remote.jianlipai.JianLiPaiTemplateClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 简历模版
 *
 * @author: CYM-pai
 * @date: 2025/05/04 21:26
 **/
@RestController
public class JianLiPaiTemplateController implements JianLiPaiTemplateClient {

    /**
     * 简历模版列表
     *
     * @return
     */
    
    @Override
    public PAIResponseBean<List<ResumeTemplateVO>> list() {
        List<ResumeTemplateVO> list = Arrays.stream(ResumeTemplateEnum.values()).map(template -> {
             return ResumeTemplateVO.builder()
                     .code(template.getCode())
                     .score(template.getScore())
                     .type(template.getType())
                     .style(template.getStyle())
                     .occupations(template.getOccupationList())
                     .cover(template.getCover())
                     .build();
         }).collect(Collectors.toList());
        return PAIResponseBeanUtil.success(list);
    }

}
